<?php 
/**
 * CHome.php
 * @author mw
 * @package Controller
 */
/**
 * CHome
 * @author mw
 * @package Controller
 *
 */
class CHome extends CController {
	/**
	 * Costruttore
	 */
	public function __construct() {
		parent::__construct();
	}
	/**
	 * Display Homepage
	 */
	public function homepage() {
		
		$creg = new CRegistrazione();
		
		$vhome = new VHome();
		
		if($creg->getUtenteLoggato()){
			$futente = new FUtente();
			$futente->search(null,array('attivato' => 1));
			$utenti = $futente->getEntities();
			$vhome->assign('iscritti',$utenti);
			
			$ffoto = new FFoto();
			$ffoto->getFotoRand();
			list($foto) = $ffoto->getEntities();
			$vhome->assign('random',$foto);
		}
		
		$vhome->homepage();
	}
	
}